<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>JS实现点击按钮清空DIV里内容</title>
  </head>

  <body>
    <div id="testid">这是测试内容！</div>
    <button onClick="clearcon()">清空编号</button>
    <script>
      function clearcon() {
        var obj = document.getElementById("testid");
        obj.innerHTML = "";
      }
    </script>
  </body>
</html>
